package mystudy
// defer关键字
import "fmt"

func DemoDefer() int{
	num1 := 1
	var num2 float32 = 1.2
	defer fmt.Println("defer 关键字1:num1=", num1)
	defer fmt.Println("defer 关键字2:num2=", num2)
	num2 = 200
	num1 = 100
	fmt.Println("num2=",num2)
	num1 += 100
	sum := float32(num1) + num2
	fmt.Println("sum=", sum)
	return 10
}